package test;
/**
 * 有三个线程，分别只能打印A，B和C
 * 要求按顺序打印ABC，打印10次
 * 输出示例：
 * ABC
 */
public class test01 {
    //private static volatile int count = 0;
    //private static Object lock = new Object();

    public static void main(String[] args) {
        Thread t1  = new Thread(() -> {
            for (int i = 0; i < 10; i++) {
                System.out.print(Thread.currentThread().getName());
                //count++;
                //lock.notify();
            }
        },"A");

        Thread t2 = new Thread(() -> {
            for (int i = 0; i < 10; i++) {
                try {
                    t1.join();
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
                System.out.print(Thread.currentThread().getName());
                }
        },"B");

        Thread t3 = new Thread(() -> {
            for (int i = 0; i < 10; i++) {



            }
        },"C");


        t1.start();
        t2.start();
        //t3.start();
    }

}


